<?php

class tsw_yesterdayRain implements ThermdSingleWidget
{
  public function drawWidget($io,$x,$y)
  {	 
		$yesterdaysrain = ThermdStats::ts_totalRainfallPeriod(86400,secondsSinceMidnight());
		$black = imagecolorallocate($io,0,0,0);
		if($yesterdaysrain===FALSE)
		{
			$yesterdaysrain = "-- ";
		}

    $icon = imagecreatefrompng(ThermdStats::$thermosrc.'rain-this.png');

    imagecopy($io,$icon,$x+106,$y,0,0,24,24);
		imagestring($io,1,$x,$y+3,"YESTERDAY'S RAINFALL",$black);
		imagestring($io,1,$x+24,$y+11,gmdate('d/m/Y',time()-86400),$black);
		imagestring($io,4,$x+135,$y+2,$yesterdaysrain.ThermdStats::$rainunits,$black);
  }
}

?>